package com.zret.oasys.entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Leavedetails {
	// 审批单号
	private int detailid;
	// 请假单号 
	private String leavenum;
	// 审批节点
	private int node = 0;
	// 当前审批人ID
	private int apprid;
	// 审批意见
	private String appcomment;
	// 收到审批的时间点  
	private Date gettime;
	// 审批时间
	private Date apptime;
	// 审批状态
	private String status;
	// 与之对应的审批单类
	private Leavetable leavetable;
	// 与之对应的员工类
	private Emp emp;
	
	// 构造函数
	public Leavedetails() {};
	
	public Leavedetails(String leavenum, int node, int apprid, String appcomment, String gettime, String status) {
		super();
		this.setDetailid(detailid);
		this.setLeavenum(leavenum);
		this.setNode(node);
		this.setApprid(apprid);
		this.setAppcomment(appcomment);
		this.setGettime(gettime);
		this.setStatus(status);
	}
	
	public Leavedetails(int detailid, String leavenum, int node, int apprid, String appcomment, Date gettime, Date apptime) {
		super();
		this.setDetailid(detailid);
		this.setLeavenum(leavenum);
		this.setNode(node);
		this.setApprid(apprid);
		this.setAppcomment(appcomment);
		this.setGettime(gettime);
		this.setApptime(apptime);
	}
	
	public Leavedetails(int detailid, String leavenum, int node, int apprid, String appcomment, String gettime, String apptime) {
		super();
		this.setDetailid(detailid);
		this.setLeavenum(leavenum);
		this.setNode(node);
		this.setApprid(apprid);
		this.setAppcomment(appcomment);
		this.setGettime(gettime);
		this.setApptime(apptime);
	}



	// 日期的格式化
	private static SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	public int getDetailid() {
		return detailid;
	}
	public void setDetailid(int detailid) {
		this.detailid = detailid;
	}
	public String getLeavenum() {
		return leavenum;
	}
	public void setLeavenum(String leavenum) {
		this.leavenum = leavenum;
	}
	public int getNode() {
		return node;
	}
	public void setNode(int node) {
		this.node = node;
	}
	public int getApprid() {
		return apprid;
	}
	public void setApprid(int apprid) {
		this.apprid = apprid;
	}
	public String getAppcomment() {
		return appcomment;
	}
	public void setAppcomment(String appcomment) {
		this.appcomment = appcomment;
	}
	public String getGettime() {
		return simple.format(gettime);
	}
	public void setGettime(Date gettime) {
		this.gettime = gettime;
	}
	
	public void setGettime(String gettime) {
		try {
			this.gettime = simple.parse(gettime);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public String getApptime() {
		return simple.format(apptime);
	}
	public void setApptime(Date apptime) {
		this.apptime = apptime;
	}
	public void setApptime(String apptime) {
		try {
			this.apptime = simple.parse(apptime);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Leavetable getLeavetable() {
		return leavetable;
	}

	public void setLeavetable(Leavetable leavetable) {
		this.leavetable = leavetable;
	}
	
	public Emp getEmp() {
		return emp;
	}

	public void setEmp(Emp emp) {
		this.emp = emp;
	}

	@Override
	public String toString() {
		return "LeaveDetails [detailid=" + detailid + ", leavenum=" + leavenum + ", node=" + node + ", apprid=" + apprid
				+ ", appcomment=" + appcomment + ", gettime=" + this.getGettime() + ", apptime=" + this.getApptime() +  "]";
	}
	
	
}

























